import { CDPetWakeStage } from "../excel/CDPetWakeStage";


/**
 * 扩展-宠物觉醒
 */
export abstract class CEPetWakeStage {

    /**初始化 */
    public static init(): void {

    }


    /**
     * 获取配置
     * @param wakeLevel 
     */
    public static getData(wakeLevel: number): CDPetWakeStage {
        const vs = CDPetWakeStage.datas.getValues();
        for (let i = 0, len = vs.length; i < len; i++) {
            const config = vs[i];
            if (config.wakeLevel === wakeLevel
                || (config.startLevel <= wakeLevel && wakeLevel <= config.endLevel)) {
                return config;
            }
        }
        return vs[0].startLevel > wakeLevel ? vs[0] : vs[vs.length - 1];
    }
}